home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / tutorial / docs.lha / documentation / app_d.eps (.svg) < prev    next >
Encapsulated PostScript  |  1993-08-09  |  31KB  |  557x1021  |  8-bit (99 colors)
Labels: black | darkness
OCR: 'twoshapes 1'IListingL Anhang D D:Lernabschnitt:14mBeispiel:ntwoshapes1 Dec 118112:11119911File: twoshapes 1.CET++Tutorial Lernabschnitt: 141Beispiel: twoshapes 1 Page 11 }{ 12 //Lernabschnitt: 1411 Beispiel: Itwoshapes1 1111111113 }{ //1tView with 12 shapes 115 //11Shapes may be moved while Cursor is in shape and left mouse button is pressed 1111111116 11 1111111117 #include 1'ET++.h" 1111111118 119 const int CSETINK+KUSERCMD1+1100, 111110 1CMAXINKS-150; 11111 12 static charfaboutMsg=fResize shapes with t@lcntl@Pandt@lleft mouse button@P"; 13 static ink palette(CMAXINKS); 1111111114 15 SymboltcDocTypeShapes ("TWOSHAPES"); 1116 17 //--Shape 1111111118 119 class Shape: public Object 1111111120 111intinkid; 21 public: 122 MetaDef(Shape); 111111123 24 Shape(Rectanglet)11(r) (inkid=13;1 111111125 111111126 111111127 111Metric GetMinSize() 128 {return Metric(5):1 129 void Draw(Rectangle) 1111111130 (GrSetink(palette(inkid]): 1111111131 1fvoid Setink(inthewink) 11111132 {inkid-thewink; Force Redraw(); Changed():1 1111111133 fint Getink() 1111111134 (treturninkid:1 1111111135 11tostream&PrintOn(ostreams) 111111136 {VObject::PrintOn(s); 1111111137 treturn tsk<inkid1SP;1 1111111138 ittistream&ReadFrom(istream&s) 1111111139 (VObject::ReadFrom(s); 111111140 treturn's b> Inkid; 141 }; 11111142 143 Metalmpl(Shape, IT (inkid))); 1111111144 1145 //----BoxShape1--- 1111111146 147 class BoxShape: public Shape 148 public: 111111149 111MetaDef(BoxShape); 1111111150 BoxShape(Rectangle 1)1 Shape(r) 1111111151 111111152 ttvold Draw(Rectangle) 11111153 154 }: 1111155 56 Metalmpl0(BoxShape); 11111157 158 //----OvalShape1- 111111159 160 class OvalShape: public Shape Ch.Frei, D.Schaudt {1Shape::Draw(r); 1GrFill Rect(contentRect);}} Software Schule Schweiz Seite: D08